package com.situ.address.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.address.service.IAddressService;
import com.situ.address.vo.LayuiTreeVO;

@Controller
@RequestMapping(value = "/test2")
public class Test2Controller {
	
	@Autowired
	//依赖注入　DI
	private IAddressService addressService;

	@RequestMapping(value = "/t3")
	public String t3() {
		return "/NewFile.jsp";
	}
	
	@RequestMapping(value = "/t4")
	public String t4() {
		return "/add.jsp";
	}
	
	@ResponseBody
	@GetMapping(value = "/tree")
	public List<LayuiTreeVO> tree() {
		return addressService.tree();
	}
	
	
}
